import request from '@/utils/request'

// 获取师训报名信息列表(带分页)
export function getTrainOrderItemList(data) {
  return request({
    url: '/api/train/sign',
    method: 'GET',
    data
  })
}

// 获取师训报名信息列表(无分页)
export function getTrainOrderItemNoPagingList(data) {
  return request({
    url: '/api/train/sign/nopaging',
    method: 'GET',
    data
  })
}

// 获取师训参训老师列表
export function getTrainParticipantList(trainId) {
  return request({
    url: `/api/train/sign/participants/${trainId}`,
    method: 'GET'
  })
}

// 获取师训报名信息详情
export function getTrainOrderItemInfo(id) {
  return request({
    url: `/api/train/sign/${id}`,
    method: 'GET'
  })
}

// 批量设置分组
export function batchSetGroup(data) {
  return request({
    url: '/api/train/sign/batch/setgroup',
    method: 'POST',
    data: data
  })
}

// 验证身份信息（通过身份证号）
export function checkTeacherByIdCard(trainId, name, idCard) {
  return request({
    url: `/api/train/sign/check/${trainId}/${encodeURIComponent(name)}/${encodeURIComponent(idCard)}`,
    method: 'GET'
  })
}

// 根据教师ID验证身份信息
export function checkTeacherById(trainId, teacherId) {
  return request({
    url: `/api/train/sign/check-teacher/${trainId}/${teacherId}`,
    method: 'GET'
  })
}
